﻿using System.Windows;

namespace Demos.Heap
{
    public abstract class ElementoVisual : DependencyObject
    {
        public double X
        {
            get { return (double)GetValue(XProperty); }
            set { SetValue(XProperty, value); }
        }

        // Using a DependencyProperty as the backing store for X.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty XProperty =
            DependencyProperty.Register("X", typeof(double), typeof(ElementoVisual), new UIPropertyMetadata(null));


        public double Y
        {
            get { return (double)GetValue(YProperty); }
            set { SetValue(YProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Y.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty YProperty =
            DependencyProperty.Register("Y", typeof(double), typeof(ElementoVisual), new UIPropertyMetadata(null));
    }

    public class Caja : ElementoVisual
    {
        public string Contenido { get; set; }

        public Caja(string contenido)
        {
            X = 0;
            Y = 0;
            Contenido = contenido;
        }
    }

    public class Bola : ElementoVisual
    {
        public string Contenido { get; set; }

        public Bola(double x, double y, string contenido)
        {
            X = x;
            Y = y;
            Contenido = contenido;
        }
    }

    public class Flecha : ElementoVisual
    {
        public double X1 { get; set; }
        public double Y1 { get; set; }
        public double X2 { get; set; }
        public double Y2 { get; set; }

        public Flecha(double x1, double y1, double x2, double y2, double x, double y)
        {
            X1 = x1;
            X2 = x2;
            Y1 = y1;
            Y2 = y2;
            X = x;
            Y = y;
        }
    }
}
